<template>
    <view class="knmnknmert">
        <view class="fz36 cf">
        	输入手机号
        </view>
		<view class="mt20 z9 fz26">
			请输入您使用的手机号
		</view>
		<input type="number" value="" v-model="phone" placeholder="" maxlength="11" class="fz30 beertert mt100"   />
		<view class="mt60 hjjnnxeert cf cen mt100" @tap="fasseddert">
			发送验证码
		</view>
    </view>
</template>
<script>
    export default {
        data() {
            return {
				phone:''
			}
        },
        components: {},
        methods: {
			async fasseddert(){
				if(!this.checkMobile(this.phone)){
					uni.showToast({
						icon:"none",
						title:'请输入您使用的手机号'
					})
					return
				}
				let cs = {}
				cs.phone = this.phone
				let jbhss =  await this.post('/api/verificationCodes',cs)
				let jhhsd = this.$store.state.userskey
				jhhsd.phone = this.phone
				jhhsd.verification_key = jbhss.key
				this.$store.commit('setuserskey',jhhsd)
				
				uni.navigateTo({
					url:"InputVerificationCode"
				})
			},
			checkMobile(tel){
				console.log(tel);
			    var reg =/^0?1[3|4|5|6|7|8][0-9]\d{8}$/;
			    return reg.test(tel);
			}
		},
        mounted() {}
    }

</script>
<style  scoped>

</style>
